const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.brandId 品牌Id
 * @param {} options.status 状态
 * @param {} options.beginCreateTime 创建时间-开始时间
 * @param {} options.endCreateTime 创建时间-结束时间
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        brandId: req.query.brandId,
        status: req.query.status,
        beginCreateTime: req.query.beginCreateTime,
        endCreateTime: req.query.endCreateTime,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id13',
                    code: 'code14',
                    brandId: 'brandId1',
                    brandCode: 'brandCode1',
                    brandName: 'brandName',
                    name: 'name15',
                    type: 1,
                    status: 1,
                    createTime: '2019-09-21T06:18:13Z',
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    options: [
                        'update',
                        'abandon'
                    ]
                },
                {
                    id: 'id16',
                    code: 'code17',
                    name: 'name18',
                    brandId: 'brandId2',
                    brandCode: 'brandCode2',
                    brandName: 'brandName2',
                    type: 1,
                    status: 1,
                    createTime: '2019-09-21T06:18:13Z',
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    options: [
                        'update',
                        'abandon'
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 订单未满足原因Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 订单未满足原因Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/abandon', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
